package com.hqd.jjvm.classformat.attributeinfo;

import com.hqd.jjvm.classformat.ClassFile;
import lombok.Getter;
import lombok.NoArgsConstructor;

@Getter
@NoArgsConstructor
public class AnnotationDefault extends AnnotationAttributeInfo {

	private ElementValuePair.ElementValue defaultValue;

	public AnnotationDefault(Integer attributeNameIndex, Integer attributeLength, ElementValuePair.ElementValue defaultValue) {
		super(attributeNameIndex, attributeLength);
		this.defaultValue = defaultValue;
	}

	@Override
	protected AnnotationDefault newAttributeInfo(Integer attributeNameIndex, Integer attributeLength, ClassFile classFile) {
		this.defaultValue = parseElementValue(classFile);
		return this;
	}
}
